<h3>Tasks</h3>

<%i=0%>

  <script type="text/javascript" src="/js/sorttable.js"></script>
  <style>
  /* Sortable tables */
  table.sortable {
    width: 100%;
    border: 0;
    table-layout:fixed;
    word-wrap:break-word;
    border-collapse:collapse;
  }

  table.sortable thead {
      background-color:#eee;
      color:#666666;
      font-weight: bold;
      cursor: default;
  }
  </style>
  <p></p>
  <table class="sortable" border="1" width=100%>
    <colgroup>
      <col style="width:5%">
      <col style="width:5%">
      <col style="width:5%">
      <col style="width:20%">
      <col style="width:30%">
      <col style="width:35%">
    </colgroup>
    <tbody>
      <tr><th>Count</th><th>Type</th><th>Passive</th><th>Name</th><th>Description</th><th>References</th></tr>
      <% @tasks.each do |t| %>
        <tr>
          <td><%=i%></td>
          <td><%= t.metadata[:type] %></td>
          <td><%= t.metadata[:passive] %></td>
          <td><%= "#{t.metadata[:pretty_name]} <a href='https://github.com/intrigueio/intrigue-core/blob/master/lib/tasks/#{t.metadata[:name]}.rb'>[code]</a>" %></a></td>
          <td><%= t.metadata[:description] %></td>
          <td><%= t.metadata[:references].map{|x| "<a href='#{x}'>#{x}</a>"}.join("<br/>") %></td>
        </tr>
        <%i+=1%>
      <% end %>
    </tbody>
  </table>
